package com.cheng.example.exception;

public class NullPointerExceptionDemo {

    public static void main(String[] args) {
        Student student = new Student();
        student.setName("张三");
        f1(student);
        f1(null);

    }


    public static void f1(Student student) {
        System.out.println(student.getName());
    }

}
